-
Notifications
You must be signed in to change notification settings - Fork 122
DRAFT README.md #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rolling
Are you sure you want to change the base?
DRAFT README.md #533
Conversation
Signed-off-by: Nils-Christian Iseke <[email protected]>
Signed-off-by: Nils-Christian Iseke <[email protected]>
Signed-off-by: Nils-Christian Iseke <[email protected]>
Signed-off-by: Nils-Christian Iseke <[email protected]>
Signed-off-by: Nils-Christian Iseke <[email protected]>
|
I don't want to pretend that I know all the answers, but I can try to share what I know.
You could just point to each tool's documentation, see my other comment.
I think it's just easier, especially for the ROS 2 core. And, for other packages, I think the tools matter more than their default configuration file, since that often depends on preferences. Also, you can run these tools yourself through the CLI, so they can be integrated into pre-commit hooks.
With
Possibly, but there hasn't been a good reason to do so yet, or at least a reason that would make the additional complexity/maintenance worth it.
The answer to this is probably partly historical. (As an aside, you might wonder: "why is it called "ament?" It's called ament because the ROS 1 equivalent(ish) of this toolset/buildsystem layer was called catkin, another name for the same flower. But why was that called "catkin?" It goes on and on 😄) I wouldn't necessarily say it's the "officially supported ROS 2 solution for lining;" it's just the most common/most well-integrated linting solution we have. As for why that is, I'd say ROS 2 converged to this solution because of what I mentioned above. Overall, given that ROS 2 is made up of a bunch of repos, it's easier to set up linters as normal tests instead of commit hooks. |
Signed-off-by: Nils-Christian Iseke <[email protected]>
| ## ament_lint | ||
|
|
||
| ament_lint contains a number of packages, each package wraps a linter into an ament_$linter CLI tool, which is then wrapped in CMake (ament_cmake_$linter) | ||
| Those linters can be used both from the command line and from CMake. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They also have a Python API, e.g., here:
ament_lint/ament_mypy/ament_mypy/main.py
Line 30 in 2bee915
| def main(argv: List[str] = sys.argv[1:]) -> int: |
|
Thanks for this detailed reply :). I'm struggling a bit to write a good summary for these thoughts. I think it's mainly because I don't understand the point of ament_lint. I understand that it's convenient for some developers to have the cmake integration, but I think many developers would also like the ability to apply the Ros core coding styles via linters without being forced to maintain their own configuration and/or use ament_lint. Personally, for example, I would just use pre-commit and run the pure linters. Maybe we can think about providing a pre-commit configruation that ros2 users can use as alternatives to the wrapped linters?. Am I missing something with this approach? |
|
I don't think there's any deep reason for the way it is. It's just one solution, and it's the one we have. It's used by the ROS 2 core, and it can be used by other users if they want to use it. In some cases, the
but, again, this is because these tools are primarily used through tests (see
I think that's probably outside of the scope of this repo, but people can do it if they want (and I know some have done it). One reason it's not done for the ROS 2 core itself is that there are so many repos and it would be annoying to set up hooks and maintain them.
I mean, you could just use the configuration file used by the corresponding
You could fetch these via |
Regarding #529.
This is just a first draft for a README (Far from beeing perfect).
I would appreciate some feedback regarding the points below.
This PR proposes an initial README to make the repository more self-contained. While minimal, it aims to:
I still have the following open questions which might be answered by the readme:
Why Not Just Share Tool Configs?
If the goal is to standardize linting, why bundle configurations with CMake integration instead of distributing standalone configs (e.g., .clang-format, flake8.ini) that developers could adopt via other tools like pre-commit?
Abstraction Tradeoffs
While CMake integration benefits some workflows, it adds a layer that complicates debugging or customization for others. For example, developers using pre-commit might see ament_lint as more of a burdon.
Could ament_lint focus on integration while decoupling from configuration?
ROS Core Team’s Reasoning, e.g:
Ament_lint is the officially supported ROS 2 solution for linting because it ...